/*function ListNode(x){
    this.val = x;
    this.next = null;
}*/
function ReverseList(pHead)
{
    // write code here
    var ret = null
    while(pHead){
      var temp = pHead.next
      pHead.next = ret
      ret = pHead
      pHead = temp
    }
    return ret
}
module.exports = {
    ReverseList : ReverseList
};